<div class="internships index">
	<h2><?php __('Internship');?></h2>
	<table cellpadding="0" cellspacing="0">
	<?php
	/**
	 * Caso não exista um Student associado com o User logado
	 * exibe o link para criar
	 */
	if(!$std){?>
		<tr>
			<td>
				<?php __("To start the internship we need some data of you")?>:
				<?php echo $this->Html->link(__('Insert Data', true), array('controller'=>'students', 'action' => 'beggin'));?>
			</td>
		</tr>
	<?php 
	} else {
		/**
		 * Caso exista um Student associado com o User logado,
		 * verifca a existência de um Internship associado a 
		 * este Student, caso não exista exibe o link para criar
		 * o internship.
		 */
		if(!$int){
			/**
			 * Exibindo link para criação do estágio supervisionado
			 */
			?>
			<tr>
				<td>
					<?php echo $this->Form->create('Internship');?>
						<fieldset>
					 		<legend><?php echo __("Start Internship", true); ?></legend>
						<?php
							$lblMsgSup = __('Supervisor', true)."<br/> (".__("If the supervisor's isn't here please go to Internships Divison", true).")";
							$lblMsgComp = __("Company", true)."<br/>".	__("Please check the CNPJ, if isn't here register a new one", true).": ".
								$this->Html->link(__("Register New Company", true), array('controller'=>'companies', 'action'=>'add'));
							
							echo $this->Form->input('supervisors_id', array('label'=>$lblMsgSup, 'display'=>'CASO', 'options' => $selectSup));
							echo $this->Form->input('supervisor_area', array('label'=>__('Supervisor Area', true)));
							echo $this->Form->input('data_inicio');
							echo $this->Form->input('data_fim');
							echo $this->Form->input('companies_id', array('label'=>$lblMsgComp, 'options' => $selectComp));
							echo $this->Form->input('areas', array('label'=>__('Intership Knowledge areas', true)));
						?>
						</fieldset>
					<?php echo $this->Form->end(__('Submit', true));?>
				</td>
			</tr>
		<?php 
		} else {
		
			if(count($docs)){
			?>
				<tr>
					<td colspan="2">
						<?php __("There are pending");?>
					</td>
				</tr>
				<tr>
					<td><?php __("You must submit the following documents to the Division of Internships")?>:</td>
					<td>
						<ul>
						<?php foreach($docs as $doc):?>
						<li><?php __($doc);?></li>
						<?php endforeach;?>
						</ul>
					</td>
				</tr>
			<?php
			}
		}
	}
	?>
	</table>
	</div>
	<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<?php if($this->Session->Read('user.level') == '1'){?>
		<li><?php echo $this->Html->link(__('List Students', true), array('action' => 'index'));?></li>
		<?php }?>
		<li><?php echo $this->Html->link(__('Logout', true), array('controller'=>'users', 'action' => 'logout'));?></li>
	</ul>
</div>